//
//  ViewController.m
//  HelloWorld
//
//  Created by student on 13-12-5.
//  Copyright (c) 2013年 niit. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad//当视图载入的时候 viewdidload会运行
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    //创建一个uilabel1对象
    UILabel*label1=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, 320, 50)];
    //设定label1的文字内容
    label1.text=@"Hello XCode";
    //设定label1的字体大小
    label1.font=[UIFont systemFontOfSize:48];
    //    [self.view addSubview:label1];
    label1.center=CGPointMake(320/2,480/2);//文字条在屏幕中居中（设定label1的中心点位置）
    label1.textAlignment=NSTextAlignmentCenter;//文字居中
    [self.view addSubview:label1];//将label1添加到当前视图
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
